<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>src\flow\model\task.js</title>
  
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="stylesheet" href="../assets/vendor/bootstrap/css/bootstrap.min.css">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
</head>
<body class="yui3-smart">
 <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
               <a class="navbar-brand mainlogo" href="/static/doc/index.html">
             
            <img alt="" src="../assets/css/logo.png" title="">
            
                
          </a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                 <ul class="nav navbar-nav">
                    
                    <li><a href="/home/index/index">首页</a>
                    </li>
                    
                    <li><a href="/static/doc/index.html">文档</a>
                    </li>
                    
                    <li><a href="/admin/index/index">演示</a>
                    </li>
                    
                    <li><a href="/home/index/log">日志</a>
                    </li>
                    
                </ul>
               <div class="navbar-form navbar-right filterAPi" autocomplete="off">
                <input type="text" id='txtSearchAPI' class="form-control search-query" placeholder="Search for API" />
                 <ul id="filterList" class="filterItems dropdown-menu" role="menu"></ul>
                </div>
            </div>
        </div>
    </nav>
    <div id="sidebar">
    <h3>Modules/Classes</h3>
        <div id="api-tabview-filter">
            <input id='txtSearch' type="search" class="form-control" placeholder="Type to filter Modules/Classes">
        </div>
        <dl id="sidebar_list">
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/admin.controller.html">admin.controller</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/admin.controller.base.html">admin.controller.base</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.controller.code.html">admin.controller.code</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.controller.index.html">admin.controller.index</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.controller.mob.html">admin.controller.mob</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/admin.model.html">admin.model</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/admin.model.code.html">admin.model.code</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.code_list.html">admin.model.code_list</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.code_lookup.html">admin.model.code_lookup</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.groupuser.html">admin.model.groupuser</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.groupuser_add.html">admin.model.groupuser_add</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.log.html">admin.model.log</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.login.html">admin.model.login</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.privilege.html">admin.model.privilege</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.teamuser.html">admin.model.teamuser</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.teamuser_add.html">admin.model.teamuser_add</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/admin.model.user.html">admin.model.user</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/cmpage.controller.html">cmpage.controller</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/cmpage.controller.base.html">cmpage.controller.base</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.controller.mob.html">cmpage.controller.mob</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.controller.module.html">cmpage.controller.module</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.controller.page.html">cmpage.controller.page</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.controller.utils.html">cmpage.controller.utils</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/cmpage.logic.html">cmpage.logic</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/cmpage.logic.page.html">cmpage.logic.page</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/cmpage.model.html">cmpage.model</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/cmpage.model.area.html">cmpage.model.area</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.base.html">cmpage.model.base</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.file_list.html">cmpage.model.file_list</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.page.html">cmpage.model.page</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.page_excel.html">cmpage.model.page_excel</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.page_lookup.html">cmpage.model.page_lookup</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.page_mob.html">cmpage.model.page_mob</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.utils.html">cmpage.model.utils</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.cmpage_global.html">cmpage.cmpage_global</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.cmpage_global_flow.html">cmpage.cmpage_global_flow</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/demo.model.html">demo.model</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/flow.model.proc_assign.html">flow.model.proc_assign</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/cmpage.model.appr.html">cmpage.model.appr</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.model.proc.html">flow.model.proc</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.model.task.html">flow.model.task</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.model.task_act.html">flow.model.task_act</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.model.task_act_appr.html">flow.model.task_act_appr</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/flow.controller.html">flow.controller</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/flow.controller.act.html">flow.controller.act</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.controller.base.html">flow.controller.base</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.controller.proc.html">flow.controller.proc</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.controller.task.html">flow.controller.task</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.controller.task_act.html">flow.controller.task_act</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
                <dt>
                    <span class="glyphicon glyphicon-minus"></span>
                    <a href="../modules/flow.model.html">flow.model</a>
                </dt>
                <dd>
                    <ul>
                   
                       <li>
                            
                           <a href="../classes/flow.model.act.html">flow.model.act</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                       <li>
                            
                           <a href="../classes/flow.model.act_path.html">flow.model.act_path</a>
                           <ul>
                                
                           </ul>
                       </li>
                    
                    </ul>
                </dd>
             
        </dl>
</div>
   
    <div class="stdoc-content">
        <!--     <form id="options-form" class="form-inline pull-right">
        Show:
        <label for="api-show-inherited" class="checkbox">
            <input type="checkbox" id="api-show-inherited" checked>
            Inherited
        </label>

        <label for="api-show-protected" class="checkbox">
            <input type="checkbox" id="api-show-protected">
            Protected
        </label>

        <label for="api-show-private" class="checkbox">
            <input type="checkbox" id="api-show-private">
            Private
        </label>
        <label for="api-show-deprecated" class="checkbox">
            <input type="checkbox" id="api-show-deprecated">
            Deprecated
        </label>

    </form>

 -->
        <div class="apidocs">
            <div id="docs-main">
                <div class="content">
                    <div class="page-header">
    <h1>src\flow\model\task.js <small>File</small></h1>
</div>

<div class="file">
    <pre class="prettyprint linenums" id='src_code'>
&#x27;use strict&#x27;;
// +----------------------------------------------------------------------
// | CmPage [ 通用页面框架 ]
// +----------------------------------------------------------------------
// | Licensed under the Apache License, Version 2.0
// +----------------------------------------------------------------------
// | Author: defans &lt;defans@sina.cn&gt;
// +----------------------------------------------------------------------

/**
 * 提供工作流控制的相关方法，业务相关，供flow/model/proc.js的方法进行调用&lt;br/&gt;
 * 具体的业务相关的工作流子类可以继承本类，来增加定制的业务逻辑
 * @class flow.model.task
 */
export default class extends think.model.base {
    proc = {};  //当前流程模板
    task = {};  //当前流程实例
    user = {};  //当前用户
    currAct = {};   //当前节点设置
    currTaskAct = {};   //当前节点实例

    /**
     * 创建(启动)一个新的流程实例(任务)
     * @method  fwStart
     */
    async fwStart(){

        this.task ={c_no:this.getTaskNo(), c_proc:this.proc.id, c_status:cmpage.enumTaskStatus.RUN, c_creater:this.user.id, c_time_create:think.datetime(),
               c_priority:cmpage.enumTaskPriority.NOMAL, c_user:this.user.id, c_time:think.datetime(), c_memo:&#x27;&#x27;, c_link:0 ,c_link_type:this.proc.c_link_type};

        await this.fwInit();

        if(this.task.c_status !== cmpage.enumTaskStatus.INIT){
            await this.addTaskSt(&#x27;模板设置错误，流程终止&#x27;);
            return;
        }
        await this.save();

        //console.log(task);

//        console.log(proc);
        let actModel = this.model(&#x27;act&#x27;);
        //取该流程模板的节点
        let acts = await actModel.getActsByProcId(this.proc.id);
//        console.log(acts);
        if(think.isEmpty(acts)){
            await this.addTaskSt(&#x27;未找到该流程模板的活动节点!&#x27;);
            return;
        }
        //按流程走向排序后加入任务节点
        let actsOrder = await actModel.getActsOrder(this.proc.id,acts);
        debug(actsOrder,&#x27;task.fwStart - actsOrder&#x27;);
        let taskActModel = this.model(&#x27;fw_task_act&#x27;);
        let taskActStartID = 0;
        for(let act of actsOrder){
            let md = {c_task:this.task.id, c_act:act.id, c_status:cmpage.enumTaskActStatus.NO_BEGIN, c_user:this.user.id, c_time_begin:think.datetime(),
                c_time:think.datetime(), c_memo:&#x27;&#x27;, c_link:0, c_link_type:&#x27;&#x27;};
            md.id = await taskActModel.add(md);
            if(act.c_type === cmpage.enumActType.START){
                taskActStartID = md.id;
            }
        }

        this.task.c_status = cmpage.enumTaskStatus.RUN;
        await this.save();

        //从开始节点进行run
        return await actModel.fwRun(taskActStartID,this.user);

    }

    /**
     * 取某个任务的当前状态，当前节点存放于 task.currAct &lt;br/&gt;
     * 子类中重写本方法，可以增加任务的初始化逻辑，比如业务相关的逻辑
     * @method  getTaskWithStatus
     * @return {object} 当前节点的模板对象
     */
    async getTaskWithCurrentAct(task){
        if(think.isEmpty(this.task)){
            this.task = task;
        }
        //debug(this.task,&#x27;task.getTaskWithCurrentAct --- this.task&#x27;);
        this.currAct = {id:0};
        if(this.task.c_status === cmpage.enumTaskStatus.RUN){
            let taskActs = await this.model(&#x27;task_act&#x27;).getTaskActs(this.task.id);
            let actModel = this.model(&#x27;act&#x27;);
            for(let ta of taskActs){
                //TODO: 可能要考虑user来进行区分
                //取当前节点
                if(ta.c_status === cmpage.enumTaskActStatus.WAIT || ta.c_status === cmpage.enumTaskActStatus.RUN || ta.c_status === cmpage.enumTaskActStatus.SUSPEND){
                    this.currTaskAct = ta;
                    this.currAct = await actModel.getActByIdAndProcId(ta.c_act, this.task.c_proc);
                    break;
                }
            }
        }
        return this.currAct;
    }

    /**
     * 初始化一个的流程实例(任务)&lt;br/&gt;
     * 子类中重写本方法，可以增加任务的初始化逻辑，比如业务相关的逻辑
     * @method  fwInit
     */
    async fwInit(){
        this.task.c_status = cmpage.enumTaskStatus.INIT;
        //如果不满足启动条件，则重置任务状态为： TERMINATE

    }

    /**
     * 根据编号规则生成任务编号&lt;br/&gt;
     * 子类中可以重写本方法，实现特殊的编号规则
     * @method  getTaskNo
     * @return {string}  新的任务编号
     */
    getTaskNo(){
        let no =&#x27;&#x27;;
        if(!think.isEmpty(this.proc.c_no_format)){
            no = cmpage.datetime(new Date(),&#x27;yyMMddHHmmss&#x27;)+cmpage.getRandomNum(1,10);
        }else{

        }
        return no;
    }

    /**
     * 运行一个流程实例(任务)
     * @method  fwRun
     */
    async fwRun(){
        if(this.task.c_status === cmpage.enumTaskStatus.SUSPEND){
            this.task.c_status = cmpage.enumTaskStatus.RUN;
            //让本实例被挂起的节点继续RUN
            let taskActs = await this.model(&#x27;task_act&#x27;).getTaskActs(this.task.id);
            for(let taskAct of taskActs){
                if(taskAct.c_status === cmpage.enumTaskActStatus.SUSPEND){
                    await this.model(&#x27;act&#x27;).fwRun(taskAct.id,this.user,taskAct);
                }
            }
            await this.save();
        }
    }

    /**
     * 挂起一个流程实例(任务)
     * @method  fwSuspend
     */
    async fwSuspend(){
        if(this.task.c_status === cmpage.enumTaskStatus.RUN){
            this.task.c_status = cmpage.enumTaskStatus.SUSPEND;
            //当前活动节点挂起
            if(think.isEmpty(this.currTaskAct)){
                await this.getTaskWithCurrentAct();
            }
            await this.model(&#x27;act&#x27;).fwSuspend(this.currTaskAct.id,user,this.currTaskAct);
            await this.save();
        }
    }

    /**
     * 终止一个流程实例(任务)
     * @method  fwTerminate
     */
    async fwTerminate(){
        if(this.task.c_status === cmpage.enumTaskStatus.RUN || this.task.c_status === cmpage.enumTaskStatus.SUSPEND ){
            this.task.c_status = cmpage.enumTaskStatus.TERMINATE;
            //当前活动节点终止
            //if(think.isEmpty(this.currTaskAct)){
            //    await this.getTaskWithCurrentAct();
            //}
            //await this.model(&#x27;act&#x27;).fwTerminate(this.currTaskAct.id,user,this.currTaskAct);
            let taskActs = await this.model(&#x27;task_act&#x27;).getTaskActs(this.task.id);
            for(let ta of taskActs){
                if(ta.c_status !== cmpage.enumTaskActStatus.TERMINATE &amp;&amp; ta.c_status !== cmpage.enumTaskActStatus.END
                    &amp;&amp; ta.c_status !== cmpage.enumTaskActStatus.NO_BEGIN){
                    await this.model(&#x27;fw_task_act&#x27;).where({id:ta.id}).update({c_status:enumTaskActStatus.TERMINATE, c_time:think.datetime(),c_user:this.user.id});
                }
            }
            //调用主关联业务模块的终止函数
            if(!think.isEmpty(this.proc.c_link_model)){
                let fnModel = cmpage.model(this.proc.c_link_model);
                if (think.isFunction(fnModel[&#x27;fwTerminate&#x27;])) {
                    await fnModel[&#x27;fwTerminate&#x27;](this.task, this.user);
                }
            }
            await this.save();
        }
    }

    /**
     * 正常结束一个流程实例(任务)，一般在结束节点执行完成后调用
     * @method  fwEnd
     */
    async fwEnd(){
        if(this.task.c_status !== cmpage.enumTaskStatus.RUN || this.task.c_status === cmpage.enumTaskStatus.SUSPEND ){
            this.task.c_status = cmpage.enumTaskStatus.END;
            await this.save();
        }
    }

    /**
     * 增加流程实例的状态记录，记录流程示例发生状态改变的时间及当时状态
     * @method  addTaskSt
     * @params {string} [desc] 状态描述
     */
    async addTaskSt(desc){
       // console.log(task);
        let task = this.task;
        if(task.id &lt;=0){
            return 0;
        }
        let md = {c_proc:task.c_proc,c_act:0,c_task:task.id, c_task_act:0, c_time:task.c_time, c_user:this.user.id, c_status:task.c_status};
        //组成状态描述
        md.c_desc = think.isEmpty(desc) ?  &#x27;流程&#x27;+ (await this.model(&#x27;cmpage/utils&#x27;).getEnumName(task.c_status,&#x27;TaskStatus&#x27;)) : desc;
        md.id = await this.model(&#x27;fw_task_st&#x27;).add(md);
        await this.model(&#x27;fw_task_st_his&#x27;).add(md);

        return md.id;
    }
    /**
     * 保存程实例记录，此处可使用缓存机制改进性能
     * @method  save
     */
    async save(){
        if(this.task.id &gt;0){
            await this.model(&#x27;fw_task&#x27;).where({id:this.task.id}).update(this.task);
        }else{
            this.task.id = await this.model(&#x27;fw_task&#x27;).add(this.task);
        }
        await this.addTaskSt();
    }

    /**
     * 取流程实例对象，此处可使用缓存机制改进性能
     * @method  getTask
     * @return {object} 流程实例对象
     * @params {int} taskID 任务对象ID
     */
    async getTask(taskID){
        return await this.model(&#x27;fw_task&#x27;).where({id:taskID}).find();
    }

    /**
     * 取流程实例的创建用户对象，供没有特定用户，如自动执行等操作调用
     * @method  getUserFromTask
     * @return {object} 流程实例的用户对象
     * @params {int} taskID 任务对象ID
     */
    async getUserFromTask(taskID){
        let task = await this.model(&#x27;fw_task&#x27;).where({id:taskID}).find();
        let user = await this.model(&#x27;admin/user&#x27;).getUserById(task.c_user);
        user.groupID = task.c_group;

        return user;
    }

    /**
     * 取流程实例对象的轨迹图,&lt;br/&gt;
     * 先取流程模板的图片数据，然后修改当前节点和执行路径的属性值
     * @method  getFlowMap
     * @return {string} 流程图形的字符串
     * @params {int} taskID 任务对象ID
     */
    async getFlowMap(taskID){
        let task = await this.getTask(taskID);
        let proc = await this.model(&#x27;fw_proc&#x27;).where({id:task.c_proc}).find();
        if(think.isEmpty(proc.c_map)){
            return &#x27;{states:{},paths:{},props:{props:{}}}&#x27;;
        }
        let flowMap = cmpage.objFromString(proc.c_map);
        let taskActs = await this.query(&#x60;select A.*,B.c_map_id from fw_task_act A, fw_act B where A.c_act=B.id and A.c_task=${taskID}&#x60;);

        for(let k in flowMap.paths){
            flowMap.paths[k].votes = 0;
        }
        for(let ta of taskActs){
            if(ta.c_status === cmpage.enumTaskActStatus.WAIT || ta.c_status === cmpage.enumTaskActStatus.SUSPEND
                ||  ta.c_status === cmpage.enumTaskActStatus.END ||  ta.c_status === cmpage.enumTaskActStatus.PENDING){
                //执行路径
                for(let k in flowMap.paths){
                    if(flowMap.paths[k].from === ta.c_map_id || flowMap.paths[k].to === ta.c_map_id){
                        flowMap.paths[k].votes += 1;
                    }
                }
            }
            if(ta.c_status === cmpage.enumTaskActStatus.WAIT || ta.c_status === cmpage.enumTaskActStatus.SUSPEND ||  ta.c_status === cmpage.enumTaskActStatus.PENDING){
                //当前节点
                debug(ta,&#x27;task.getFlowMap - ta-current&#x27;);
                debug(flowMap.states[ ta.c_map_id],&#x27;task.getFlowMap - flowMap.states[ta.c_map_id]&#x27;);
                if(flowMap.states[ ta.c_map_id]){
                    flowMap.states[ ta.c_map_id].attr.stroke =  &#x27;#ff0000&#x27;;
                }
            }else if(ta.c_status === cmpage.enumTaskActStatus.END ){
                //历史节点
                if(flowMap.states[ ta.c_map_id]){
                    flowMap.states[ ta.c_map_id].attr.stroke =  &#x27;#e87e38&#x27;;
                }
            }else if(ta.c_status === cmpage.enumTaskActStatus.TERMINATE ){
                //被终止节点
                if(flowMap.states[ ta.c_map_id]){
                    flowMap.states[ ta.c_map_id].attr.stroke =  &#x27;#000000&#x27;;
                }
            }
        }
        for(let k in flowMap.paths){
            if(flowMap.paths[k].votes === 2){       //执行路径
                flowMap.paths[k].attr = {path : {stroke : &#x27;#ff6600&#x27; }, arrow : { stroke : &#x27;#ff6600&#x27;, fill : &quot;#ffb584&quot; }};
            }
        }

        debug(flowMap.states,&#x27;task.getFlowMap - flowMap.states&#x27;);
        return cmpage.objToString(flowMap);
    }

}

    </pre>
</div>

                </div>
            </div>
        </div>
    </div>
<a id="gotoTop" class='well well-small' href='#'>
    Top
</a>
<script src="../assets/vendor/jquery/jquery-1.8.2.min.js"></script>
<script src="../assets/vendor/bootstrap/js/bootstrap.min.js"></script>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script src="../assets/js/config.js"></script>
<script src="../assets/js/doc.js"></script>
</body>
</html>
